home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP Products & Services 1994 Summer
/
NeXTSTEP Products & Services 1994 Summer.iso
/
AlembicDemo.app
/
PaperSight
/
PaperSight.app
/
FAX
< prev
next >
Wrap
Text File
|
1994-03-09
|
4KB
|
164 lines
#!/bin/csh
set DEFPSIGHT = /LocalApps/PaperSight.app
set DEFMODEM = Local_Fax_Modem
if ($1 != "") then
if ($2 == "") then
set psightdir=$1
goto gotPsightDir
endif
if (($1 == \?) || ($2 == "") || ($3 == "") || ($4 != "")) then
echo Usage: ConfigurePaperSightFaxes \[\[PaperSightDirectory\] FaxModemName UserName\]
exit 0
endif
set psightdir=$1
set faxmodem=$2
set username=$3
goto justDoIt
else
set tmp = $0
set tmp1 = $tmp:h
set tmp2 = $tmp1:h
if ($tmp2 != "") then
set psightdir = $tmp2
goto gotPsightDir
endif
endif
echo Installing PaperSight fax receipt
set wai = `whoami`
if ($wai != root) then
echo User $wai cannot install fax receipt. You need to be root to do this.
exit 0
endif
whereIsPsight:
echo
echo -n Where is PaperSight\? \["${DEFPSIGHT}"\]" "
set ANS = ($<)
if ("${ANS}" == "") set ANS = "${DEFPSIGHT}"
set psightdir = "${ANS}"
gotPsightDir:
test -r "${psightdir}"/FAX/psight_faxreceiver30
if ($status != 0) then
echo "${psightdir}"/FAX/psight_faxreceiver30 does not exist.
goto whereIsPsight
endif
whichModem:
echo
echo -n Which fax modem\? \["${DEFMODEM}"\]" "
set ANS = ($<)
if ("${ANS}" == "") set ANS = "${DEFMODEM}"
set faxmodem = "${ANS}"
/usr/bin/niutil -list . /fax_modems/$faxmodem >& /dev/null
if ($status != 0) then
echo There is no local fax modem named $faxmodem
goto whichModem
endif
test -r "${psightdir}"/FAX/psight_faxreceiver30
if ($status != 0) then
echo "${psightdir}"/FAX/psight_faxreceiver30 does not exist.
goto whereIsPsight
endif
whichUser:
echo -n Which user should receive faxes\?" "
set ANS = ($<)
if ("${ANS}" == "") goto whichUser
set username = "${ANS}"
test -r ~$username
if ($status != 0) then
echo Could not find a home directory for $username.
goto whichUser
endif
test -r ~$username/.psight.conf
if ($status != 0) then
echo User $username is not a PaperSight user, he/she has no file cabinets.
goto whichUser
endif
set tmp = `/usr/bin/niutil -read . /users/$username |& grep uid:`
if ($status != 0) then
set tmp = `/usr/bin/niutil -read ./.. /users/$username |& grep uid:`
if ($status != 0) then
set tmp = `/usr/bin/niutil -read ./../.. /users/$username |& grep uid:`
if ($status != 0) then
set tmp = "uid: -1"
endif
endif
endif
@ userid = $tmp[2]
if ($userid <= 0) then
echo Couldn\'t find user $username.
goto whichUser
else
echo User $username found, uid=$userid
endif
echo " "
echo Configuring for fax receipt.
justDoIt:
# Final test
test -r "${psightdir}"/FAX/psight_faxreceiver30
if ($status != 0) then
echo "${psightdir}"/FAX/psight_faxreceiver30 does not exist.
exit 0
endif
/usr/bin/niutil -list . /fax_modems/$faxmodem
if ($status != 0) then
echo There is no local fax modem named $faxmodem
exit 0
endif
test -r ~$username
if ($status != 0) then
echo Could not find a home directory for $username.
exit 0
endif
test -r ~$username/.psight.conf
if ($status != 0) then
echo User $username is not a PaperSight user, he/she has no file cabinets.
exit 0
endif
set tmp = `/usr/bin/niutil -read . /users/$username |& grep uid:`
if ($status != 0) then
set tmp = `/usr/bin/niutil -read ./.. /users/$username |& grep uid:`
if ($status != 0) then
set tmp = `/usr/bin/niutil -read ./../.. /users/$username |& grep uid:`
if ($status != 0) then
set tmp = "uid: -1"
endif
endif
endif
@ userid = $tmp[2]
if ($userid <= 0) then
echo Couldn\'t find user $username.
exit 0
endif
/usr/bin/niutil -createprop . /fax_modems/$faxmodem receive_filter /usr/lib/NextPrinter/mail_faxes
/usr/bin/niutil -createprop . /fax_modems/$faxmodem ReceiverUID $userid
if ($status != 0) then
echo Fatal error, could not create property for fax modem $faxmodem.
exit 1
endif
test -r /usr/lib/NextPrinter/NEXcleanup
if ($status != 0) then
mv /usr/lib/NextPrinter/faxcleanup /usr/lib/NextPrinter/NEXcleanup
endif
cp "${psightdir}"/FAX/psight_faxreceiver30 /usr/lib/NextPrinter/faxcleanup
chmod 6755 /usr/lib/NextPrinter/faxcleanup